/********************************************************************************
*                 Copyright (C) 2011 - Las Venturas Playground                  *
*                      http://iv-mp.nl | http://lvp-iv.com                      *
*                                                                               *
*    This program is free software: you can redistribute it and/or modify       *
*    it under the terms of the GNU General Public License as published by       *
*    the Free Software Foundation, either version 3 of the License, or          *
*    (at your option) any later version.                                        *
*                                                                               *
*    This program is distributed in the hope that it will be useful,            *
*    but WITHOUT ANY WARRANTY; without even the implied warranty of             *
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
*    GNU General Public License for more details.                               *
*                                                                               *
*    You should have received a copy of the GNU General Public License          *
*    along with this program.  If not, see <http://www.gnu.org/licenses/>.      *
*                                                                               *
*********************************************************************************
*                                                                               *
*  Las Venturas Playground - callbacks/onScriptInit.nut                         *
*                                                                               *
*  The onScriptInit callback is located here.                                   *
*                                                                               *
********************************************************************************/

/**
 * This event is called when a user was killed or killed somebody.
 *
 */
function onScriptInit()
{
    // The server has succesfully started
    log ("\n-----------------------------------");
    log ("LVP:IV Loaded");
    log ("-----------------------------------\n");
    
    // Create a new instance of the MySQL class.
    local Database = MySQL ();
    
    // Connect to the database
    Database.connect ();
    
    // Wait, are we actually connected?
    if(Database.isConnected ()) 
    {
        log ("[MySQL] Succesfully connected to the MySQL server.");
    }
    else
    {
        log ("[MySQL] Failed to connect to the MySQL server.");
    }
    
    // Create a new instance of the Vehicle class
    local Vehicle = Vehicle ();
    
    // Load the vehicles from the database.
    Vehicle.loadVehicles ();
	
	// Load the deathmatch minigames
	loadDeathmatchMinigames ();
    return 1;
}

addEvent("scriptInit", onScriptInit);